import React from 'react'
import { Typography, List, Radio  } from 'antd'
import price from '../../helper/price'
const { Title } = Typography


export default function FilterByPrice({handleFilter}) {
	const onChange = (e) => {
		// 将当前选中的数据传递给父组件
		handleFilter(e.target.value);
	}
	return (
		<>
			<Title level={5}>按照价格筛选</Title>
			<Radio.Group onChange={onChange}>
				<List 
					dataSource={price}
					renderItem={item=>
						<List.Item>
							<Radio value={item.array}>{item.name}</Radio>
						</List.Item>
					}
				>
				</List>
			</Radio.Group>
		</>
	)
}
